import config from "@/config";
import http from "@/utils/request";
export default {
	available: {
		url: `${config.API_URL}/ai/wiki/wiki/list/available`,
		name: "列表",
		get: async function () {
			return await http.get(this.url);
		},
	},
	page: {
		url: `${config.API_URL}/ai/wiki/wiki/page/list`,
		name: "分页列表",
		get: async function (data) {
			return await http.post(this.url, data);
		},
	},
	update: {
		url: `${config.API_URL}/ai/wiki/wiki/update`,
		name: "更新",
		post: async function (data) {
			return await http.post(this.url, data);
		},
	},
	remove: {
		url: `${config.API_URL}/ai/wiki/wiki/delete`,
		name: "删除",
		post: async function (data) {
			return await http.get(this.url + "?id=" + data);
		},
	},
	detail: {
		url: `${config.API_URL}/ai/wiki/wiki/detail`,
		name: "详情",
		post: async function (id) {
			return await http.get(this.url + "?id=" + id);
		},
	},

	create: {
		url: `${config.API_URL}/ai/wiki/wiki/add`,
		name: "创建",
		post: async function (data) {
			return await http.post(this.url, data);
		},
	},

	knowledgeCreate: {
		url: `${config.API_URL}/ai/wiki/wiki/knowledge/create`,
		name: "创建",
		post: async function (data) {
			return await http.post(this.url, data);
		},
	},
	knowledgePageList: {
		url: `${config.API_URL}/ai/wiki/wiki/knowledge/page/list`,
		name: "获取知识列表-分页",
		get: async function (data) {
			return await http.post(this.url, data);
		},
	},
	knowledgeVectorPageList: {
		url: `${config.API_URL}/ai/wiki/wiki/knowledge/vector/page/list`,
		name: "查看 知识列表下的 向量",
		get: async function (data) {
			// wikiDetailId, page, size
			return await http.get(
				this.url +
					"?wikiDetailId=" +
					data.wikiDetailId +
					"&page=" +
					data.page +
					"&size=" +
					data.pageSize
			);
		},
	},
	knowledgeVectorSearch: {
		url: `${config.API_URL}/ai/wiki/wiki/knowledge/vector/search`,
		name: "向量搜索查询",
		post: async function (data) {
			return await http.post(this.url, data);
		},
	},
	knowledgeVectorRetry: {
		url: `${config.API_URL}/ai/wiki/wiki/knowledge/vector/retry`,
		name: "重新生成向量",
		get: async function (data) {
			return await http.get(this.url + "?id=" + data);
		},
	},
	knowledgeVectorRemove: {
		url: `${config.API_URL}/ai/wiki/wiki/knowledge/vector/remove`,
		name: "删除向量",
		get: async function (data, wikiDetailId) {
			return await http.get(
				this.url +
					"?documentId=" +
					data +
					"&wikiDetailId=" +
					wikiDetailId
			);
		},
	},
	knowledgeRemove: {
		url: `${config.API_URL}/ai/wiki/wiki/knowledge/remove`,
		name: "删除知识点",
		get: async function (data) {
			return await http.get(this.url + "?id=" + data);
		},
	},
};
